import { BaseResCoverDto } from '@/common/dto/base-rescover.dto';
import { ResultRoleConverterDto } from '@/modules/roles/dto/result-converter.dto';
import { Exclude, Expose, Type } from 'class-transformer';

export class ResultUserConverterDto extends BaseResCoverDto {
  @Expose()
  id: any;

  @Expose()
  username: any;

  @Expose()
  status: any;

  // 复用角色DTO
  @Expose({ groups: ['showSysRoles'] }) // 外面 groups: [] 数组中存在 "showSysRoles" 才会显示
  @Type(() => ResultRoleConverterDto)
  sysRoles: ResultRoleConverterDto;

  @Expose()
  gender: any;

  @Expose()
  deptId: any;

  @Expose()
  nickname: any;

  @Expose()
  mobile: any;

  @Expose()
  email: any;

  @Exclude()
  password: any;
}
